<!DOCTYPE html>
<html lang="zh-Hans-CN">
<head>
    <meta charset="UTF-8">
    <title>事件修饰符:.prevent 阻止默认行为</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="../vue.js"></script>
</head>
<body>
<h2>【例21】事件修饰符:.prevent 阻止默认行为</h2>
<hr>
<div id="app">
    <a target="_blank" href="https://www.baidu.com" v-on:click.prevent="do1">阻止默认行为</a><br>
    <a target="_blank" href="https://www.baidu.com" v-on:click="do1">不阻止默认行为</a><br>
    <a target="_blank" href="https://www.baidu.com" @click="do1">不阻止默认行为@</a>
</div>
<script>
    let vm = new Vue({
        el: '#app',
        methods: {
            do1() {
                console.log('元素单击事件');
            }
        }
    })
</script>
<hr>
<p><a href="index.html">返回章节目录</a>
    <script>document.write(document.lastModified); </script>
</p>
</body>
</html>
